
#pragma once
#include <cstdarg>
#include <iostream>

#include "../utils/Log.h"

struct lua_State;

namespace Zha
{

class LuaManager
{
public:
	LuaManager(std::string scriptPath);
	~LuaManager();
public:
	int CallFunc(const char* funcName, const std::string fmt, ...);
	lua_State* GetLuaState();
	void NewGlobalTable(char *name);
	short SetIntToGlobalTable(char *tbName, char *key, int value);
	short SetStringToGlobalTable(char *tbName, char *key, char *value);

protected:
	int InitLuaState();

protected:
	lua_State *m_pLuaState;
	std::string m_scriptPath;
};

}
